// More is Better
#include <iostream>
#include <vector>
#include <map>
using namespace std;

vector<int> boys;
map< int, long > people;
map<int, long> ::iterator it;;

int find(int r)
{
    while (boys[r] != r)
    {
        r = boys[r];
    }
    return r;
}

void merge(int a, int b)
{
    int r1 = find(a);
    int r2 = find(b);
    if (r1 != r2)
    {
        boys[a] = b;
        it = people.find(r2);
        if(it == people.end())
        {
            people.insert(pair <int, long>(r2, 1));
        }
        else
        {
            it->second ++;
        }
    }
}

int main()
{
    ios::sync_with_stdio(false);
    int n, friend1, friend2;
    long max;
    while(cin >> n)
    {
        boys.clear();
        boys.push_back(0);
        for(int i=1; i<=n; i++)
        {
            boys.push_back(i);
        }
        for(int i=1; i<=n; i++)
        {
            cin >> friend1 >> friend2;
            for(int j=0; j < (int) boys.size(); j++)
            {
                merge(friend1, friend2);
            }
        }
        max = 0;
        it = people.begin();
        while(it != people.end())
        {
            if(it -> second >max)
            {
                max = it->second;
            }
            it++;
        }
        cout << max << endl;
    }
}